home *** CD-ROM | disk | FTP | other *** search
- /* 4567890123456789012345678901234567890123456789012345678901234567 */
- #include <Gestalt.h>
-
- #include "Toolbox.h"
- #include "HasRequiredFeatures.h"
-
- static Boolean IsSystemSeven(void);
-
- Boolean HasRequiredFeatures(void) {
- Boolean hasRequiredFeatures;
-
- if (HasFeature(gestaltAppleEventsAttr, gestaltAppleEventsPresent) &&
- HasFeature(gestaltFSAttr, gestaltHasFSSpecCalls) &&
- HasFeature(gestaltNotificationMgrAttr,
- gestaltNotificationPresent) &&
- HasFeature(gestaltPopupAttr, gestaltPopupPresent) &&
- HasFeature(gestaltFindFolderAttr, gestaltFindFolderPresent) &&
- HasFeature(gestaltAliasMgrAttr, gestaltAliasMgrPresent) &&
- IsSystemSeven()) {
- hasRequiredFeatures = true;
- } else {
- hasRequiredFeatures = false;
- }
- return hasRequiredFeatures;
- }
-
- Boolean IsSystemSeven(void) {
- long theResponse;
- OSErr theError;
- Boolean isSystemSeven;
- short theSystemVersion;
-
- theError = Gestalt(gestaltSystemVersion, &theResponse);
- if (theError == noErr) {
- theSystemVersion = (theResponse & 0xFF00) >> 8;
- if (theSystemVersion == 0x07) {
- /*
- * System 7.x.x
- */
- isSystemSeven = true;
- } else {
- /*
- * Some future System (probably Copland) is System 8.x.x
- * Some of our code will need to be revisited in Copland.
- * This is a sure way to see to it that we do. When the
- * code stops working, our unhappy customers will surely
- * tell us to fix it!
- */
- isSystemSeven = false;
- }
- } else {
- /*
- * An error occurred.
- */
- isSystemSeven = false;
- }
- return isSystemSeven;
- }
-